const { override, addWebpackAlias, addLessLoader, addWebpackExternals } = require('customize-cra');
const path = require('path');

// 更改打包路径
const paths = require('react-scripts/config/paths');
paths.appBuild = path.join(path.dirname(paths.appBuild), 'dist');

module.exports = override(
  addWebpackAlias({
    "@": path.resolve(__dirname, "src")
  }),

  // addWebpackExternals({
  //   'electron': "electron",
  // }),
  
  addLessLoader({
    sourceMap:true,
    noIeCompat:true,
    javascriptEnabled: true,
    modifyVars: {
      '@my-color': '#1DA57A'
    }
    // cssModules:{
    //     localIdentName: "[path][name]__[local]--[hash:base64:5]", // if you use CSS Modules, and custom `localIdentName`, default is '[local]--[hash:base64:5]'.
    // }
  }),
  (config) => { 
    // config.target = 'electron-renderer'
    return config;
  }
);